<template>
	<view class="topcon">
		<view class="topli topback">
			<text class="iconfont" v-if="toplevel==1" @click="gohome">&#xe67c;</text>
			<text class="iconfont" v-else-if="toplevel==2" @click="goback">&#xe6ad;</text>
			<text v-else></text>
		</view>
		<!-- <view class="topli topclose">
			<text class="iconfont">&#xe651;</text>
		</view> -->
	</view>
</template>

<script>
	export default {
		name:"apptop",
		props: {
			toplevel:{
				type:Number,
				default:0 //0首页 1 tab页 2内页
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			gohome(){
				uni.switchTab({
					url:"/pages/index/index"
				})
			},
			goback(){
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="less">
.topcon{
	width: 100vw;
	position: fixed;
	top: 0;
	left: 0;
	z-index: 1000;
	display: flex;
	justify-content: space-between;
	// align-items: center;
	background-image: url("/static/image/bg.gif");
	background-size: cover;
	background-repeat: no-repeat;
	height: 200rpx;
	.topli{
		height: 32px;
		line-height: 32px;
		margin: 10px;
		color: #ffffff;
		.iconfont{
			font-size: 45rpx;
		}
	}
	.topclose{
		width: 87px;
		background-color: rgba(0, 0, 0, .7);
		border-radius: 16px;
		border: 1px solid #ccc;
		text-align: center;
	}
}
</style>